package t20211204;

/**
 * @Author: DengJia
 * @Date: 2021/12/4 14:14
 * @Description:
 */

public class NestingInterfaces {

}

class A {
    public interface B {
        void out();
    }

    public class BImpl implements B {
        @Override
        public void out() {
            System.out.println("class BImpl");
        }
    }

    private interface D {
        void out();
    }

    private class DImpl1 implements D {
        @Override
        public void out() {
            System.out.println("class DImpl1");
        }
    }

    public class DImpl2 implements D {
        @Override
        public void out() {
            System.out.println("class DImpl2");
        }
    }

    public B getB() {
        return new BImpl();
    }

    public D getD() {
        return new DImpl2();
    }

    public DImpl2 getDImpl2() {
        return new DImpl2();
    }

    private D dRef;

    public void receive(D d) {
        dRef = d;
        dRef.out();
    }
}

interface X {
    interface Y {

    }
}

class XImpl implements X {

}
